#ifndef QUESTIONDIALOG_H
#define QUESTIONDIALOG_H

#include <QDialog>
#include <QScrollArea>
#include <QTextBrowser>
#include "model/data.h"

class QuestionCard;

namespace Ui {
class QuestionDialog;
}

class QuestionDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QuestionDialog(QWidget *parent = nullptr);
    ~QuestionDialog();

    void set(const model::QuestionClusterInfo& questionCluster);

private slots:
    void on_btn_close_clicked();

private:
    void init();
    void initStyleSheet();
    void initPanel();
    void initBody();

    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    bool _isDraging = false;
    QPoint _dragPosition;

    void setCardList(const QList<model::QuestionInfo> &questions);
    QList<QuestionCard*> _cards;
    void turnToInterview(const model::QuestionInfo& question);

private:
    QWidget *_container = nullptr;
    QScrollArea *_scrollArea = nullptr;
    QTextBrowser *_content = nullptr;

private:
    Ui::QuestionDialog *ui;
};

#endif // QUESTIONDIALOG_H
